package com.itheima.chapter01.method;

import java.util.Scanner;

/*
    方法调用:打印n-m之间的奇数
 */
public class demo3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你要查询的起始数据");
        int i = sc.nextInt();
        System.out.println("请输入你要查询的结束数据");
        int j = sc.nextInt();
        System.out.println("奇数有：");
        print(i,j);

    }
    public static void print(int i,int j){
        if(i>j){
            System.out.println("您输入的数据有误");
        }else{
            for (int k = i; k <= j; k++) {
                if(k%2==1){

                    System.out.println(k);
                }

            }
        }

    }
}
